<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 如果一个函数的参数有默认值，尽量（一定）让这个默认值的参数位置靠后
        function fn(a=10,b){
            console.log(a,b);
        }
        fn(99,88);//99,88
        fn(77);//77,undefined

        function fn1(b,a=10){
            console.log(b,a);
        }
        fn1(99);//99,10
    </script>
</body>
</html>